package us.sunrisemorning.pixivbrower.utils;

import com.jfinal.plugin.activerecord.dialect.Sqlite3Dialect;
import com.jfinal.plugin.activerecord.generator.Generator;
import com.jfinal.plugin.c3p0.C3p0Plugin;

public class ModelGenerator {
    public static void main(String[] args) {
        C3p0Plugin plugin = new C3p0Plugin("jdbc:sqlite:pixivbrower.db", null, null, "org.sqlite.JDBC");
        plugin.start();
        
        Generator gen = new Generator(
                plugin.getDataSource(),
                "us.sunrisemorning.pixivbrower.model.base",
                "src/main/java/us/sunrisemorning/pixivbrower/model/base",
                "us.sunrisemorning.pixivbrower.model",
                "src/main/java/us/sunrisemorning/pixivbrower/model");
        gen.setDialect(new Sqlite3Dialect());
        gen.setMetaBuilder(new MyMetaBuilder(plugin.getDataSource()));
        gen.addExcludedTable("db_version");
        gen.generate();
    }
}
